<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1">
  <title id="cw20941">DROP EXTENSION</title>
  <body>
    <p id="sql_command_desc">Removes an extension from a Greenplum database.</p>
    <section id="section2">
      <title>Synopsis</title>
      <codeblock id="sql_command_synopsis">DROP EXTENSION [ IF EXISTS ] <varname>name</varname> [, ...] [ CASCADE | RESTRICT ]</codeblock>
    </section>
    <section id="section3">
      <title>Description</title>
      <p><codeph>DROP EXTENSION</codeph> removes extensions from the database. Dropping an extension
        causes its component objects to be dropped as well. </p>
      <note>The required supporting extension files what were installed to create the extension are
        not deleted. The files must be manually removed from the Greenplum Database hosts.</note>
      <p>You must own the extension to use <codeph>DROP EXTENSION</codeph>.</p>
      <p>This command fails if any of the extension objects are in use in the database. For example,
        if a table is defined with columns of the extension type. Add the <codeph>CASCADE</codeph>
        option to forcibly remove those dependent objects.</p>
      <note type="important">Before issuing a <codeph>DROP EXTENSION</codeph> with the
          <codeph>CASCADE</codeph> keyword, you should be aware of all object that depend on the
        extension to avoid unintended consequences.</note>
    </section>
    <section id="section4">
      <title>Parameters</title>
      <parml>
        <plentry>
          <pt>IF EXISTS</pt>
          <pd>
            <p>Do not throw an error if the extension does not exist. A notice is issued.</p>
          </pd>
        </plentry>
        <plentry>
          <pt><varname>name</varname></pt>
          <pd>
            <p>The name of an installed extension.</p>
          </pd>
        </plentry>
        <plentry>
          <pt>CASCADE</pt>
          <pd>
            <p>Automatically drop objects that depend on the extension, and in turn all objects that
              depend on those objects. See the PostgreSQL information about <xref
                href="https://www.postgresql.org/docs/9.6/ddl-depend.html" format="html"
                scope="external">Dependency Tracking</xref>.</p>
          </pd>
        </plentry>
        <plentry>
          <pt>RESTRICT</pt>
          <pd>
            <p>Refuse to drop an extension if any objects depend on it, other than the extension
              member objects. This is the default.</p>
          </pd>
        </plentry>
      </parml>
    </section>
    <section id="section6">
      <title>Compatibility</title>
      <p><codeph>DROP EXTENSION</codeph> is a Greenplum Database extension. </p>
    </section>
    <section id="section7">
      <title>See Also</title>
      <p><codeph><xref href="CREATE_EXTENSION.xml#topic1">CREATE EXTENSION</xref></codeph>,
            <codeph><xref href="ALTER_EXTENSION.xml#topic1">ALTER EXTENSION</xref></codeph></p>
    </section>
  </body>
</topic>
